﻿using System;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace RedSand.Site.Models
{
    public class NewsInfo
    {
        [Key]
        [HiddenInput(DisplayValue = false)]
        public int NewsID { get; set; }

        [Display(Name = "UserID")]
        [Required]
        public int UserID { get; set; }

        [Display(Name = "CategoryID")]
        [Required]
        public int CategoryID { get; set; }

        [Display(Name = "Title")]
        [Required]
        public string Title { get; set; }

        [Display(Name = "Description")]
        public string Description { get; set; }

        [Display(Name = "Content")]
        public string Content { get; set; }

        [Display(Name = "Image")]
        public string Image { get; set; }

        [Display(Name = "CreateDate")]
        [DataType(DataType.Date)]
        public DateTime? CreateDate { get; set; }

        [Display(Name = "PublishDate")]
        [DataType(DataType.Date)]
        public DateTime? PublishDate { get; set; }

        [Display(Name = "Language")]
        public string Language { get; set; }

        [Display(Name = "Type")]
        public byte? Type { get; set; }

        [Display(Name = "IsHot")]
        public bool? Priority { get; set; }

        [Display(Name = "Views")]
        public int? Views { get; set; }

        [Display(Name = "Status")]
        public byte? Status { get; set; }
    }

    public class NewsSearchModel
    {
        public string Keyword { get; set; }
        public int? CategoryID { get; set; }
        public byte? CategoryType { get; set; }
        public byte? Type { get; set; }
        public byte? Status { get; set; }
        public bool? Priority { get; set; }
        public string Language { get; set; }
    }
}
